
begintalkscript;

variables;
int bottles, bodies;

begintalknode 10;
	state = -1;
	nextstate = 10;
	question = "Miali";
	text1 = "Miali lies prone on the ground, occasionally shuddering. But fortunately, she doesn't seem to be injured very seriously, aside from the poison you know is coursing through her veins.";
	text2 = "You should probably do something, and very quickly.";

begintalknode 11;
	state = 10;
	nextstate = 30;
	condition = get_skill_total(12) > 4;
	question = "(Use priestly magic)";
	text1 = "You carefully cast a spell of curing, even though you're fairly certain that you'll succeed... there won't be any room for error here.";
	text2 = "It doesn't take all that long until the spell finishes, meaning that Miali should wake up any moment now.";

begintalknode 12;
	state = 10;
	nextstate = 30;
	condition = (get_skill_total(17) > 8) && ((has_item(177) == 1) || (has_item(178) == 1));
	question = "(Use first aid)";
	text1 = "You whip out a first aid kit and start digging around, hoping to find some sort of antivenom. Thankfully, you find a small bottle with _curing potion_ scrawled on it at the bottom of the kit.";
	text2 = "You carefully tilt Miali's head back, and then you dump the bottle's contents down her throat. With any luck, the potion should take effect very quickly.";

begintalknode 13;
	state = 10;
	nextstate = 30;
	condition = (has_item(221) == 1) || (has_item(229) == 1) || (has_item(240) == 1) || (has_item(237) == 1);
	question = "(Use a potion)";
	text1 = "Thankfully, you know that you have a potion that should cure the poison. You practically rip your equipment apart trying to find it, but soon enough, your fingers find a small glass bottle.";
	text2 = "You carefully tilt Miali's head back, and then dump the potion down her throat. With any luck, the potion will take effect rather quickly.";
	code = 
		if(has_item(221) == 1)
			take_item(221);
		else if(has_item(229) == 1)
		take_item(229);
		else if(has_item(240) == 1)
		take_item(240);
		else if(has_item(237) == 1)
		take_item(240);
	break;
begintalknode 14;
	state = 10;
	nextstate = -1;
	question = "(Wait)";
	text1 = "You wait, nervously hoping that Miali's condition improves. There's a chance that the poison might not kill her, after all.";
	text2 = "A few moments later, you see that Miali has stopped breathing. She doesn't make a sound as she passes.";
	action = END_TALK;
	code = 
		put_item_on_spot(29,13,447);
		set_flag(10,1,1);
		set_flag(5,15,0);
		erase_char(8);
	break;
begintalknode 20;
	state = -1;
	nextstate = 20;
	question = "Miali";
	text1 = "This woman lies on the ground, in the middle of the forge, and she appears to be unconscious. She looks like she's been injured pretty badly.";
	text2 = "Miali lies on the ground, and she still appears to be unconscious. Unfortunately, it looks like she was injured pretty badly.";
	text3 = "You should probably do something to heal her.";
	code = 
		if((get_flag(4,29) == 1) || (get_flag(14,0) == 1) || (get_flag(0,6) == 1) || (get_flag(11,1) == 1))
			remove_string(1);
		else
		remove_string(2);
	break;

begintalknode 21;
	state = 20;
	nextstate = 21;
	condition = get_skill_total(12) > 2;
	question = "(Use priestly magic)";
	text1 = "You carefully cast a healing spell, fairly certain that there won't be any room for error here.";
	text2 = "It doesn't take all that long until the spell is complete. If it worked, Miali should wake up any moment now.";

begintalknode 22;
	state = 20;
	nextstate = 21;
	condition = (get_skill_total(17) > 4) && ((has_item(177) == 1) || (has_item(178) == 1));
	question = "(Use first aid)";
	text1 = "You whip out a first aid kit and start tending to her injuries. Thankfully, you are competent enough to dress the wounds and stop the bleeds you find.";
	text2 = "Once you finish, you sit back and wait, until her breathing slowly becomes a bit more regular. With any luck, she should wake up pretty soon.";

begintalknode 23;
	state = 20;
	nextstate = 21;
	condition = (has_item(220) == 1) || (has_item(228) == 1) || (has_item(240) == 1) || (has_item(237) == 1);
	question = "(Use a potion)";
	text1 = "Thankfully, you know that you have a potion that should heal her. You practically rip your equipment apart trying to find it, but soon enough, your fingers find a small glass bottle.";
	text2 = "You carefully tilt Miali's head back, and then dump the potion down her throat. With any luck, the potion should heal her, and she should wake up soon.";
	code = 
		if(has_item(220) == 1)
			take_item(220);
		else if(has_item(228) == 1)
		take_item(228);
		else if(has_item(240) == 1)
		take_item(240);
		else if(has_item(237) == 1)
		take_item(240);
	break;
begintalknode 24;
	state = 20;
	nextstate = -1;
	question = "(Wait)";
	text1 = "You wait, nervously hoping that Miali's condition improves. She doesn't look like she's lost much blood, after all.";
	text2 = "However, a few minutes later, you see that Miali has stopped breathing. She doesn't make a sound as she passes.";
	action = END_TALK;
	code = 
		put_item_on_spot(29,13,447);
		set_flag(10,1,1);
		set_flag(5,15,0);
		erase_char(8);
	break;

begintalknode 40;
	state = 21;
	nextstate = 22;
	question = "(Try to wake her)";
	text1 = "After trying gentle nudges, yelling, and shaking her, you finally just pull out a waterskin and pour some water on her face. She wakes with a start, and quickly sits bolt upright. Shortly after this, she clutches her head and moans a bit.";
	text2 = "_Who... who are you?_ she asks, clearly a little disoriented. She must've been knocked around a bit when the blasts hit.";
	text3 = "You explain who you are, and what you think happened to her. She seems to understand well enough.";
	text4 = "_I... my name is Miali. I don't believe we've met... but my husband will surely be glad to meet you._";
	text5 = "_I thought I recognized you from somewhere... Iracos will definitely want to speak with you._";
	text6 = "_Anyway, I think I can get myself out of here... as long as you help me up._";
	code = 
		if((get_flag(0,6) == 1) || (get_flag(11,1) == 1))
			remove_string(4);
		else
		remove_string(5);
	break;
begintalknode 41;
	state = 22;
	nextstate = -1;
	question = "(Help her up)";
	text1 = "You carefully help Miali to her feet. Luckily, it seems that her legs are perfectly fine, and she'll be able to get out under her own power.";
	text2 = "As she walks over to the ladder, she reminds you to speak with her husband Iracos. Then, she climbs up and out of the forge, leaving you alone and in the dark.";
	text3 = "On the whole, you feel that this could've been a lot worse.";
	action = END_TALK;
	code = 
		set_flag(10,1,0);
		erase_char(8);
	break;
begintalknode 30;
	state = 30;
	nextstate = 31;
	question = "(Wait, then try to wake her)";
	text1 = "While you wait for her to wake up, you carefully move Stirlen's body behind a crumpled shelf. Then, after a few moments of incredibly tense silence, you decide to try and rouse Miali from unconsciousness.";
	text2 = "When gentle nudging, yelling at her, and shaking her all fail, you finally decide to just take out a waterskin and dump some water on her face. She wakes with a start, and quickly sits bolt upright. Shortly after this, she clutches her head and moans.";
	text3 = "_Who... who are you?_ she asks, clearly still a bit disoriented. She must've been knocked around a bit when the blasts hit. That is, assuming that Stirlen didn't do anything to her.";
	text4 = "You explain who you are, and try to explain what happened, leaving Stirlen and the poison out of the story completely.";
	text5 = "_I... my name is Miali. I don't believe we've met... but my husband will surely be glad to meet you._";
	text6 = "_I thought I recognized you from somewhere... Iracos will definitely want to speak with you._";
	text7 = "_Anyway, I think I can get myself out of here... as long as you help me up._";
	code = 
		if(get_flag(11,1) == 1)
			remove_string(6);
		else
		remove_string(5);
	break;
begintalknode 31;
	state = 31;
	nextstate = -1;
	question = "(Help her up)";
	text1 = "You carefully help Miali to her feet. Luckily, it seems that her legs are perfectly fine, and she'll be able to get out under her own power.";
	text2 = "As she walks over to the ladder, she reminds you to speak with her husband Iracos. Then, she climbs up and out of the forge, leaving you alone and in the dark.";
	text3 = "On the whole, this could've been worse... somehow. Then again, you should just be glad that Miali didn't see Stirlen's body. ";
	action = END_TALK;
	code = 
		set_flag(10,1,0);
		set_flag(5,15,0);
		erase_char(8);
	break;
